﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.Customers>" %>
<%@ Import Namespace="CRM.AuthorizedActionLink.Extensions" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
   <%: Html.DisplayFor(model => model.Name) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">





<h2><%: Html.DisplayFor(model => model.Name) %>/<%: Html.DisplayFor(model => model.SequentialNumber) %>/<%: Html.DisplayFor(model => model.ProfineRegionNameLocalized)%>/<%: Html.DisplayFor(model => model.Manager)%></h2>

<p>
  
    <%: Html.ActionLink(CRM.Resourses.Resourses.BackToList, "Index") %>
</p>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>


<script type="text/javascript">
    function OnRowClick(s, e) {
        s.GetRowValues(e.visibleIndex, "IdEquipment;Model;VendorNameExt", GetRowValuesCallback);
    }
    function GetRowValuesCallback(values) {
        //alert(values);
        ddeEquipment.SetKeyValue(values[0]);
        ddeEquipment.SetText(values[1] + " " + values[2]);
        ddeEquipment.HideDropDown();
    }
</script> 


<br/><% 
       
       Html.DevExpress().PageControl(settings =>
                                         {
                                             settings.Name = "pcFeatures";
                                             settings.TabPages.Add(CRM.Resourses.Resourses.General).SetContent(() => Html.RenderAction("GeneralEdit"));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.LegalEntities).SetContent(() => Html.RenderPartial("LegalEntitiesEdit", Model));
                                             //settings.TabPages.Add(CRM.Resourses.Resourses.AgreementElements).SetContent(() => Html.RenderPartial("AgreementElementsEdit", Model));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.Contracts).SetContent(() => Html.RenderAuthorizedCustomerAction("CustomerContractsPartialEdit", "Contracts", new { customerId = Model.IdCustomer }));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.Conditions).SetContent(() => Html.RenderAuthorizedCustomerAction("ConditionsPartialEdit", "Contracts", new { customerId = Model.IdCustomer }));
                                            settings.TabPages.Add(CRM.Resourses.Resourses.AddressesAndContacts).SetContent(() => Html.RenderPartial("AddressesAndContactsEdit", Model));
                                            
                                             settings.TabPages.Add(CRM.Resourses.Resourses.Equipment).SetContent(() => Html.RenderPartial("EquipmentEdit", Model));
                                           ////  settings.TabPages.Add(CRM.Resourses.Resourses.Objects).SetContent(() => Html.RenderPartial("ObjectsEdit", Model));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.ProductPortfolio).SetContent(() => Html.RenderPartial("ProductSystemsEdit", Model));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.TC).SetContent(() => Html.RenderAuthorizedCustomerAction( "CustomerTrainingEdit","TC", new { customerId = Model.IdCustomer }));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.TechnicService).SetContent(() => Html.RenderAction("CustomerTechnicEdit", "TD", new { customerItem = Model }));
                                             settings.TabPages.Add(CRM.Resourses.Resourses.TCAuthorization).SetContent(() => Html.RenderAuthorizedCustomerAction("CustomerAuthorizationEdit", "TC", new { customerId = Model.IdCustomer }));

                                             settings.Width = Unit.Percentage(100);
                                         }).GetHtml();

       //Html.DevExpress().TextBox(settings =>
       //                              {
       //                                  settings.Name = "SequentialNumber";


       //                              }).Bind(Model.SequentialNumber).GetHtml();
        %>


     


</asp:Content>
